package com.ycy.chuwenuniapp.controller;

import com.ycy.chuwenuniapp.common.ResData;
import com.ycy.chuwenuniapp.dto.GoodsOutboundRecordDto;
import com.ycy.chuwenuniapp.entity.AdminKey;
import com.ycy.chuwenuniapp.entity.GoodsOutboundRecord;
import com.ycy.chuwenuniapp.service.AdminKeyService;
import com.ycy.chuwenuniapp.service.GoodsOutboundRecordService;
import com.ycy.chuwenuniapp.vo.GoodsOutboundRecordVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "商品出库记录管理")
@RequestMapping("/goodsOutboundRecord")
@RestController
public class GoodsOutboundRecordController {
    @Resource
    private GoodsOutboundRecordService goodsOutboundRecordService;

    @PostMapping("/save")
    @ApiOperation("新增或修改")
    public ResData<Boolean> saveRecord(@RequestBody GoodsOutboundRecord entity) {
        return goodsOutboundRecordService.saveRecord(entity);
    }


    @PostMapping("/findAll")
    @ApiOperation("查询全部")
    public ResData<List<GoodsOutboundRecordVo>> findAll(@RequestBody GoodsOutboundRecordDto dto) {
        return goodsOutboundRecordService.findAll(dto);
    }
}
